from abc import ABC, abstractmethod

from .job import Job, JobDoneUpdateModel, JobRunTimesUpdateModel


class JobStore(ABC):
    """任务存储接口"""

    @abstractmethod
    def add(self, job: Job):
        """新增任务"""
    
    @abstractmethod
    def update_run_times(self, job_id: str, model: JobRunTimesUpdateModel):
        """任务执行次数更新"""

    @abstractmethod
    def done(self, job_id: str, model: JobDoneUpdateModel):
        """任务完成状态更新"""